package com.emokili.ewa.app.controller;

import com.emokili.ewa.app.service.AccountSettingService;
import com.emokili.ewa.common.utils.R;
import com.emokili.ewa.core.frame.service.MemberService;
import com.emokili.ewa.core.frame.vo.AccountSettingVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("v1/app")
public class AccountSettingController {
    @Autowired
    private AccountSettingService accountSettingService;

    @RequestMapping("/account/setting/{memberId}")
    @ResponseBody
    public R accountSetting(@PathVariable Long memberId){
        AccountSettingVo accountSettingVo = accountSettingService.findById(memberId);
        return R.ok().setData(accountSettingVo);
    }

    @PostMapping("/account/setting/update")
    @ResponseBody
    public R update(@RequestBody AccountSettingVo accountSettingVo){
        accountSettingService.update(accountSettingVo);
        return R.ok();
    }


}
